<template>
    <div>
        <span>v-model</span>
        <input v-model="inputVal" />
        <span>语法糖分解</span>
        <input v-bind:value="inputVal" @input="inputHandler" />
        <my-button @click="inputVal='测试'">
            设置输入框的值为：测试
        </my-button>
        {{inputVal}}
    </div>
</template>
<script>
import myButton from "./views/Lesson9/button.vue";
export default {
  components: {
    myButton,
  },
  data() {
    return {
      inputVal:''
    };
  },
  methods: {
    inputHandler(event){
      this.inputVal=event.target.value
    }
  },
};
</script>
<style scoped>
</style>